﻿@{
    ViewBag.Title = "用户管理";
    int roleId = (int)ViewBag.RoleID;
}

@using Webdiyer.WebControls.Mvc;
@using EFramework.Entities.Domain.Account;
@model PagedList<EF_Account_UserInfoEntity>
@section bread
{
     <li><a href="@Url.Action("users", "Security")">用户管理</a></li>
    <li class="active">系统用户</li>
}
<div class="page-content">
    <div class="page-header">
        <h1>系统用户
		@*<small>
            <i class="icon-double-angle-right"></i>
            overview &amp; stats
        </small>*@
        </h1>
    </div>
    <div class="row">
        <div class="col-xs-12">
            @using (Html.BeginForm("users", "Security", new { pageIndex = "" }, FormMethod.Get, new { id = "searchForm", role = "form", @class = "form-inline" }))
            {
                <div class="form-group">
                    <input type="text" class="form-control" name="UserName" placeholder="登录名" value="@ViewBag.UserName" />
                </div>
                <div class="form-group">
                    <select name="roleId" class="form-control" id="roleId">
                        <option value="0">所有角色</option>
                        @foreach (var item in EFramework.Services.AccountService.GetAvailableRoles())
                        {
                            <option @if (item.RoleID == roleId)
                                    {<text>selected="selected"</text>} value="@item.RoleID">@item.RoleName</option>
                        }
                    </select>
                </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-info">
                        <i class="icon-search "></i>
                        检索		
                    </button>
                </div>
            }
            <div class="table-responsive" id="divRoleUsers">
                @Html.Partial("_AjaxUsersPartial", Model)
            </div>
        </div>
    </div>
</div>
@section scripts{
    @{Html.RegisterMvcPagerScriptResource();}
    <script type="text/javascript">
        
    </script>

}